home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / CVersCaption 1.3.1 / CVersCaption.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-12  |  4.8 KB  |  186 lines  |  [TEXT/CWIE]

  1. /*******************************************************************************\
  2. |                                                                                |
  3. |  CVersCaption.h ©1997 John C. Daub.  All rights reserved                        |
  4. |                                                                                |
  5. |  See the file "CVersCaption README" for full details, instructions, changes,    |
  6. |  licensing agreement, etc.  Due to the important information included in that    |
  7. |  file, if you did not receive a copy of it, please contact the author for        |
  8. |  a copy.                                                                        |
  9. |                                                                                |
  10. |  John C. Daub <mailto:hsoi@eden.com>                                            |
  11. |  <http://www.eden.com/~hsoi/>  <http://www.eden.com/~hsoi/prog.html>            |
  12. |                                                                                |
  13. \*******************************************************************************/
  14.  
  15. #ifndef _H_CVersCaption
  16. #define _H_CVersCaption
  17.  
  18. #pragma once
  19.  
  20. #if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
  21.     #pragma import on
  22. #endif
  23.  
  24. #include <PP_Prefix.h>
  25. #include <LCaption.h>
  26.  
  27. enum {
  28.     STR_dot = 9500,            // the period/seperator between numbers
  29.     STR_devel = 9501,        // "1.1d1"
  30.     STR_alpha = 9502,        // "1.1a1"
  31.     STR_beta = 9503,        // "1.1b1"
  32.     STRx_countries = 9500    // the STR# with the country codes, index == code
  33.     
  34. };
  35.  
  36. class CVersCaption : public LCaption {
  37.  
  38. public:
  39.  
  40.         enum { class_ID = 'VCpt' };
  41.     
  42.     #if ( __PowerPlant__ < 0x01608000 ) // version 1.6/CW11
  43.         static CVersCaption*    CreateFromStream( LStream *inStream );
  44.     #endif
  45.                                 CVersCaption();
  46.                                 CVersCaption( const CVersCaption &inOriginal );
  47.                                 CVersCaption( const SPaneInfo &inPaneInfo,
  48.                                                     ConstStringPtr inString,
  49.                                                     ResIDT inTextTraitsID,
  50.                                                     Boolean inUseShortString = false,
  51.                                                     Boolean inUseCountryCode = false );
  52.                                 CVersCaption( LStream *inStream );
  53.  
  54.         virtual                    ~CVersCaption();
  55.  
  56.                 CVersCaption&    operator=( const CVersCaption &inOriginal );
  57.         
  58.         
  59.         // these are public in case someone might need them, but I
  60.         // generally wouldn't recommend their use
  61.         
  62.         virtual    Uint32            GetVersion() const;
  63.         virtual void            SetVersion( const Uint32 inVersion );
  64.  
  65.  
  66. protected:
  67.  
  68.         virtual    void            DrawSelf();
  69.  
  70.         virtual void            ActivateSelf();
  71.         virtual void            DeactivateSelf();
  72.  
  73.         
  74.         // these accessors made protected. I can't see the outside
  75.         // needing this information, but subclasses might
  76.         
  77.         virtual    Boolean            GetUseShortString() const;
  78.         virtual void            SetUseShortString( const Boolean inUseShortString );
  79.         
  80.         virtual Boolean            GetUseCountryCode() const;
  81.         virtual void            SetUseCountryCode( const Boolean inUseCountryCode );
  82.         
  83.         
  84. private:
  85.  
  86.                 void            InitVersCaption();
  87.  
  88.                 Uint32            mVersion;
  89.                 Boolean            mUseShortString;
  90.                 Boolean            mUseCountryCode;
  91.  
  92.  
  93. };
  94.  
  95. //========================================================================
  96. //    ••• CVersCaption inline functions
  97. //========================================================================
  98.  
  99.  
  100. //========================================================================
  101. //    • GetVersion                        [public]
  102. //========================================================================
  103. //    Returns the version as a Uint32 (NumVersion)
  104.  
  105. inline
  106. Uint32
  107. CVersCaption::GetVersion() const
  108. {
  109.     return mVersion;
  110. }
  111.  
  112.  
  113. //========================================================================
  114. //    • SetVersion                        [public]
  115. //========================================================================
  116. //    Sets the version to the given Uint32 (NumVersion)
  117.  
  118. inline
  119. void
  120. CVersCaption::SetVersion(
  121.     const Uint32 inVersion )
  122. {
  123.     mVersion = inVersion;
  124. }
  125.  
  126.  
  127. //========================================================================
  128. //    • GetUseShortString                    [protected]
  129. //========================================================================
  130. //    Returns if we're using the shortString or not
  131.  
  132. inline
  133. Boolean
  134. CVersCaption::GetUseShortString() const
  135. {
  136.     return mUseShortString;
  137. }
  138.  
  139.  
  140. //========================================================================
  141. //    • SetUseShortString                    [protected]
  142. //========================================================================
  143. //    Sets the use of the short string to true or false
  144.  
  145. inline
  146. void
  147. CVersCaption::SetUseShortString(
  148.     const Boolean inUseShortString )
  149. {
  150.     mUseShortString = inUseShortString;
  151. }
  152.  
  153.  
  154. //========================================================================
  155. //    • GetUseCountryCode                    [protected]
  156. //========================================================================
  157. //    Returns if we're printing country codes or not
  158.  
  159. inline
  160. Boolean
  161. CVersCaption::GetUseCountryCode() const
  162. {
  163.     return mUseCountryCode;
  164. }
  165.  
  166.  
  167. //========================================================================
  168. //    • SetUseCountryCode                    [protected]
  169. //========================================================================
  170. //    Sets the use of the country code to true or false
  171.  
  172. inline
  173. void
  174. CVersCaption::SetUseCountryCode(
  175.     const Boolean inUseCountryCode )
  176. {
  177.     mUseCountryCode = inUseCountryCode;
  178. }
  179.  
  180.  
  181.  
  182. #if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
  183.     #pragma import reset
  184. #endif
  185.  
  186. #endif // _H_CVersCaption